/*
 * =====================================================================================
 *
 *       Filename:  Adapter.cpp
 *
 *    Description:  
 *
 *        Version:  1.0
 *        Created:  2015年02月09日 15时27分51秒
 *       Revision:  none
 *       Compiler:  gcc
 *
 *         Author:  LiuYi (), swliuyi@gmail.com
 *   Organization:  
 *
 * =====================================================================================
 */
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <vector>
#include <limits.h>
#include <iostream>
#include  <memory>

using namespace std;

class Target
{
    public:
        virtual void Request()
        {
            cout<<"A normal request"<<endl;
        }
};

class Adaptee
{
    public:
        void OldMethod()
        {
            cout<<"A special Request"<<endl;
        }
};

class Adatper : public Target
{
    private:
        shared_ptr<Adaptee> m_ptrAdaptee;
    public:
        Adatper():m_ptrAdaptee(new Adaptee){}
        void Request()
        {
            m_ptrAdaptee->OldMethod();
        }
};

int main(int argc, char *argv[])
{
    shared_ptr<Target> ptr(new Adatper());
    ptr->Request();
}
